package cn.edu.baiyunu.myapplication.data.model

/**
 * 证件照规格数据类
 */
data class PhotoSpec(
    val id: String,          // 规格唯一标识
    val name: String,        // 规格名称，如"一寸照"
    val category: String,    // 规格类别，如"证件照"
    val width: Float,         // 宽度（毫米）
    val height: Float,        // 高度（毫米）
    val description: String = "",
    val imageSample: String = ""  // 添加默认空字符串
) {
    companion object {
        /**
         * 创建参考画布规格
         * 基于实际规格创建一个更大的参考画布规格
         */
        fun createReferenceCanvas(spec: PhotoSpec, ratio: Float = 1.5f): PhotoSpec {
            val refWidth = spec.width * ratio
            val refHeight = spec.height * ratio
            
            return PhotoSpec(
                id = "ref_${spec.id}",
                name = "${spec.name} (参考画布)",
                category = spec.category,
                width = refWidth,
                height = refHeight,
                description = "参考画布: ${refWidth}x${refHeight}mm (实际: ${spec.width}x${spec.height}mm)"
            )
        }
    }
} 